package com.applcn.user.controller.applet;

import com.applcn.core.base.Result;
import com.applcn.user.dto.WxLoginDTO;
import com.applcn.user.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * com.applcn.user.controller
 * Description:
 *
 * @author: 大妖怪
 * @date: 2020-01-18 00:46
 */
@RestController
@RequestMapping("/applet/api/user")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    /**
     * 微信登录
     *
     * @param wxLoginDTO
     * @return
     */
    @PostMapping("/wxLogin")
    public Result wxLogin(@RequestBody @Validated WxLoginDTO wxLoginDTO) {
        return userService.wxLogin(wxLoginDTO);
    }
}
